Traffic congestion ranks among the issues in swiftly growing urban areas leading to delays, higher fuel usage, accidents and environmental harm. Conventional traffic control systems respond to congestion after it occurs of forecasting and avoiding it. This study introduces a Machine Learning (smart traffic congestion forecasting and route optimization solution that utilizes both historical and real-time traffic data, like vehicle volume, velocity, road occupancy, weather conditions and time. Models such as Random Forest, Support Vector Machines (SVM) and particularly LSTM networks are utilized to predict congestion because of their excellent capacity to learn temporal patterns. The system incorporates route optimization employing algorithms like Dijkstra and A* to suggest the least congested route. Real-time data, from GPS and IoT sensors allow for route adjustments. Experimental findings show that the model attains high prediction precision and substantially lowers travel time compared to navigation systems. The system supports adaptive learning, improving its performance as more data is collected.
Introduction
Rapid urbanization and vehicle growth have caused severe traffic congestion, leading to longer travel times, fuel wastage, economic losses, and increased CO? emissions. Traditional traffic systems rely on static signal timings and reactive management, while current navigation tools only display real-time conditions without predicting future congestion or suggesting intelligent rerouting.
Recent advancements in IoT, GPS, data analytics, and machine learning (ML) allow for accurate traffic prediction and proactive route optimization. ML models, particularly LSTM networks, can analyze temporal traffic patterns influenced by time, weather, and historical trends. Integrating these predictions with route optimization algorithms like Dijkstra and A* enables forecast-driven, congestion-aware routing, reducing travel time, fuel consumption, and urban traffic impact.
Objectives:
Predict congestion using ML models and time-series analysis.
Forecast traffic conditions with LSTM for temporal accuracy.
Optimize routes by incorporating congestion predictions into graph algorithms.
Minimize travel time, fuel consumption, and congestion in urban areas.
Existing System Limitations:
Static, reactive traffic signal management.
Navigation apps show live traffic but cannot predict future congestion.
Limited use of historical data, IoT, and ML for dynamic route guidance.
Results in inefficient routing, longer travel, and higher fuel usage.
Proposed Solution – Clear Route AI:
A machine-learning-driven platform combining:
Traffic Forecasting: LSTM, Random Forest, and SVM predict congestion levels.
IoT & Sensor Integration: Real-time traffic data collection from GPS, sensors, and CCTV.
Route Optimization Engine: Dijkstra/A* algorithms use congestion-adjusted edge weights.
Monitoring & Visualization: Interactive dashboards show congestion heatmaps, predicted traffic flows, and AI-recommended optimal routes.
Methodology:
Data Collection: Multi-source data from historical datasets, IoT sensors, GPS logs, and public APIs; includes traffic volume, speed, incidents, and weather.
ML-Based Prediction: LSTM and other models predict congestion levels; evaluated using RMSE, MAE, and R² metrics.
Real-Time Sensing: YOLOv8 object detection counts vehicles from CCTV and drone footage to calculate congestion indices.
Route Optimization: Graph-based algorithms adjust edge weights based on predicted congestion; reinforcement learning refines routing decisions in real-time.
Decision & Visualization: Integrated layer combines predictions, live density, and optimal routes, displayed via interactive dashboards using Folium, Matplotlib, and mapping frameworks.
Implementation:
Frontend: React.js dashboard for users, interactive maps, route comparisons, and real-time updates via WebSockets.
Backend: FastAPI handles REST/WebSocket endpoints, ML inference, and congestion data streaming; task queues manage retraining and processing.
ML & Computer Vision: LSTM, Random Forest, Gradient Boosting for prediction; YOLOv8 for vehicle detection and traffic density estimation.
Conclusion
Urban traffic jams remain one of the enduring issues in contemporary city transportation impacting travel speed economic output and environmental health. The investigation outlined in this paper shows that combining Machine Learning (ML) with route optimization provides an exceptionally efficient approach to addressing this escalating challenge. By utilizing both past and current traffic data the designed system effectively understands traffic behaviours and forecasts upcoming congestion, with great precision. Among the models assessed LSTM demonstrated the effectiveness because of its capacity to grasp temporal relationships and long-distance sequence patterns making it suitable, for predicting traffic fluctuations during the day.
Beyond forecasting integrating graph-based route optimization techniques—like Dijkstra and A*—converts congestion predictions into routing choices. By assigning congestion values to edge weights the system produces routes that\'re both shorter and intelligently devised to avoid anticipated congestion areas. This twofold approach leads to decreases in travel duration, fuel usage and overall congestion levels, on key roadways. The system’s modular architecture, which combines IoT sensors, GPS data streams, machine learning models, and visualization dashboards, ensures that it can dynamically adapt to sudden fluctuations in traffic caused by accidents, weather changes, roadwork, or peak-hour surges.
References
[1] M. Yasir, M. Asad, N. Nower, M. Shoyaib, “Traffic Congestion Prediction Using Machine Learning Techniques.” Available:
https://arxiv.org/html/2206.10983v5.
[2] W. Fahsetal., “Traffic Congestion Prediction Based on Multivariate” (ScienceDirect) Available
https://www.sciencedirect.com/science/article/pii/S187705092300563X.
[3] Shah, A., Prof, J. B., Kulkarni, R. P, Gogave S, & Sisode, V. (2025). Traffic control system and technologies: a survey. Int J Eng Res Technology 9(01), 1-5
[4] A. L. Toba, “Long-Term Traffic Prediction Using Deep Learning” (MDPI) Available: https://www.mdpi.com/2624-6511/8/4/126.
[5] M. Attioui & M. Lahby, “Congestion Forecasting Using Machine Learning Techniques: A Systematic Review.” Available: https://www.mdpi.com/2673-7590/5/3/76
[6] D.Mahajan,V.V. Pottigar, S.C, A.Fahad, “Implementing Real-Time Traffic Flow Prediction Using“ Available:
https://internationalpubls.com/index.php/cana/article/view/1705.
[7] Prakash, P., Singh, A., Parasrampuria, A., & Sharma, G. (2024). An iot based smart traffic management system. International Journal of Electrical, Electronics and Computers, 6, 6 11.Chicago.
[8] Reddy, P. V. S., Bhavani, A., & Saranya, C. (2023). Smart Traffic Congestion Control System: Leveraging Machine Learning for Urban Traffic Optimization.
[9] A. F. M. Faisal, “A Machine Learning Approach to Predicting and Mitigating Traffic Jams,” 2024. Available:
https://dspace.bracu.ac.bd/xmlui/bitstream/handle/10361/23938/20301240%2C%2020301256%2C%2020301103%2C%2023141068_CSE.pdf?isAllowed=y&sequence=1
[10] Verma, K., & Paike, V. (2023). Smart City Intelligent System Traffic Congestion Optimization using Internet Of Things. arXiv preprint arXiv:1911.01286.
[11] M. K. Vadaliya, “A Python-Based Framework for Real-Time Traffic Congestion Prediction Using Hybrid Machine Learning Models,” 2025. Available: https://ssrn.com/abstract=5215361.
[12] D. Soni, “Improved Road Traffic Congestion Prediction Using Machine Learning Models and a New Traffic Congestion Index,” 2025. Available: https://www.atlantis-press.com/proceedings/ramsita-25/126011486